This repository was archived by the owner on Dec 17, 2024. It is now read-only.
Open
Conversation
webmaster128
reviewed
Aug 9, 2023
Collaborator
webmaster128
left a comment
There was a problem hiding this comment.
Looks good at first glance. Pretty straight forward. It just need a bit of refinement to ensure we don't break existing users.
| job_id: String, | ||
| ) -> Result<Response, ContractError> { | ||
| let config = CONFIG.load(deps.storage)?; | ||
| let callback_address = info.clone().sender; |
Collaborator
There was a problem hiding this comment.
No need to clone the whole info, you can just clone the sender:
Suggested change
| let callback_address = info.clone().sender; | |
| let callback_address = info.sender.clone(); |
| /// Beacon publish time must be > `after` | ||
| after: Timestamp, | ||
| /// The callback data set by the proxy in a proxy specific format. | ||
| callback: Binary, |
Collaborator
There was a problem hiding this comment.
We can easily keep this enum case compatible by avoiding the rename origin -> callback. Then we only have an RequestScheduleJob addition here.
| AtJob, | ||
| } | ||
| impl RequestType { | ||
| pub fn to_string(&self) -> &str { |
Collaborator
There was a problem hiding this comment.
Here you can implement Display which gives you a to_string() implementation for free
| /// The callback data set by the proxy in a proxy specific format. | ||
| callback: Binary, | ||
| }, | ||
| RequestScheduleJob { |
Collaborator
There was a problem hiding this comment.
I think we should have a corresponding OutPacket::DeliverScheduleJob case which does not contain the randomness field
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is incomplete but I would like to get a general opinion on if this refactoring is going the right path or no.